class Stock:
    def __init__(self, data):
        self.data = data
        self.dates = list(self.data.keys())
        # self.ids = [i for i in self.data['2010-01-04'].index]
        self.ids = ['600150.XSHG', '600900.XSHG', '600048.XSHG', '600340.XSHG', '600569.XSHG',
                    '600019.XSHG', '600115.XSHG', '600118.XSHG', '600151.XSHG', '000001.XSHE',
                    '600030.XSHG', '601001.XSHG', '601857.XSHG', '600028.XSHG', '600050.XSHG',
                    '000063.XSHE', '000651.XSHE', '600111.XSHG', '600518.XSHG', '600056.XSHG', '600519.XSHG']
        self.items = [i for i in self.data['2010-01-04'].columns]

    # 获得某支股票在某天的开盘价
    def open_price(self, id, date):
        return self.data[date]['open'][id]
    # 获得某支股票在某天的收盘价
    def close_price(self, id, date):
        return self.data[date]['close'][id]
    # 获得某支股票在某天的最高价
    def high_price(self, id, date):
        return self.data[date]['high'][id]
    # 获得某支股票在某天的最低价
    def low_price(self, id, date):
        return self.data[date]['low'][id]
    # 获得某支股票在某天的RSI指标
    def rsi(self, id, date):
        return self.data[date]['RSI'][id]